// init include server
if (isServer) then {
// turn on/off smoke, means enemy will throw smoke grenades if true
d_smoke = true;

#ifdef __DEFAULT__
d_bonus_create_pos = [4140.94,11077.3,0];
d_bap_counter = 0;
d_bonus_air_positions = [
	[[4550.3,2229.1,0], 0],
	[[4567.3,2229.1,0], 0],
	[[4587.3,2229.1,0], 0],
	[[4607.3,2229.1,0], 0],
	[[4627.3,2229.1,0], 0],
	[[4647.3,2229.1,0], 0],
	[[4667.3,2229.1,0], 0]

];
#endif
#ifdef __TT__
d_bonus_create_pos_w = [4498.87,2731.55,0];
d_bap_counter_w = 0;
d_bonus_air_positions_w = [
	[[4787.15,2434.09,0], 33],
	[[4822.69,2411.15,0], 33],
	[[4852.8,2389.71,0], 33],
	[[4888.91,2367.47,0], 33],
	[[4925.14,2344.73,0], 33]
];

d_bonus_create_pos_e = [12609.9,12486.8,0];
d_bap_counter_e = 0;
d_bonus_air_positions_e = [
	[[12155.7,12747.9,0], 200],
	[[12183.7,12736.2,0], 200],
	[[12209.8,12726.5,0], 200],
	[[12233.7,12717.8,0], 200],
	[[12269.9,12703.3,0], 200]
];
#endif
#ifdef __EVERON__
d_bonus_create_pos = [4990.15,12084.1,0];
d_bap_counter = 0;
d_bonus_air_positions = [
	[[4874.98,11455.4,0], 270],
	[[4875,11385.5,0], 270],
	[[4878.97,11330.5,0], 270],
	[[4814.34,11410.2,0], 90],
	[[4813.5,11464.7,0], 90]
];
#endif

#ifdef __DEFAULT__
d_bvp_counter = 0;
d_bonus_vec_positions = [
	[[4475.75,2170.6812,0], 212],
	[[4485.75,2170.6812,0], 212],
	[[4500.75,2170.6812,0], 212],
	[[4515.75,2170.6812,0], 212],
	[[4530.75,2170.6812,0], 212],
	[[4545.75,2170.6812,0], 212],
	[[4560.75,2170.6812,0], 212],
	[[4575.75,2170.6812,0], 212],
	[[4590.75,2170.6812,0], 212],
	[[4605.75,2170.6812,0], 212],
	[[4630.75,2170.6812,0], 212],
	[[4645.75,2170.6812,0], 212]
];
#endif
#ifdef __TT__
d_bvp_counter_w = 0;
d_bonus_vec_positions_w = [
	[[5071.31,2352.51,0], 212],
	[[5095.94,2338.93,0], 212],
	[[5120.67,2323.57,0], 212],
	[[5147.34,2306.6,0], 212],
	[[5169.8,2292.16,0], 212]
];

d_bvp_counter_e = 0;
d_bonus_vec_positions_e = [
	[[11937.9,12683.1,0], 15],
	[[11909.5,12691.1,0], 15],
	[[11885.3,12700.7,0], 15],
	[[11861.4,12708.5,0], 15],
	[[11833.7,12718.1,0], 15]
];
#endif
#ifdef __EVERON__
d_bvp_counter = 0;
d_bonus_vec_positions = [
	[[4871.23,11569.1,0], 270],
	[[4874.05,11532.8,0], 270],
	[[4876.1,11503.9,0], 270]
];
#endif

d_compositions_common = [
	"BunkerMedium01",
	"BunkerMedium02",
	"BunkerMedium03",
	"BunkerMedium04",
	"BunkerSmall01",
	"CityBase04",
	"CityBase02"
];

d_compositions_west = [
	"Camp1_US",
	"Camp2_US",
	"Camp3_US",
	"CheckPoint1_US",
	"GuardPost2_US"
];

d_compositions_east = [
	"Camp1_RU",
	"Camp2_RU",
	"WeaponsStore1_RU"
];

d_firebase = if (d_enemy_side == "EAST") then {"Firebase1_RU"} else {"Firebase1_US"};

d_artillery_radar = switch (d_enemy_side) do {
	case "WEST": {"USMC_WarfareBArtilleryRadar"};
	case "EAST": {"RU_WarfareBArtilleryRadar"};
	case "GUER": {"Gue_WarfareBArtilleryRadar"};
};

d_air_radar = switch (d_enemy_side) do {
	case "WEST": {"USMC_WarfareBAntiAirRadar"};
	case "EAST": {"RU_WarfareBAntiAirRadar"};
	case "GUER": {"GUE_WarfareBAntiAirRadar"};
};

d_enemy_hq = switch (d_enemy_side) do {
	case "EAST": {"BTR90_HQ_unfolded"};
	case "WEST": {"LAV25_HQ_unfolded"};
	case "GUER": {"BRDM2_HQ_Gue_unfolded"};
};

// _E = East
// _W = West
// _G = Guer
// this is what gets spawned
d_allmen_E = [
	["East","RU","Infantry","RU_InfSquad"] call XfGetConfigGroup,
	["East","RU","Infantry","RU_InfSection"] call XfGetConfigGroup,
	["East","RU","Infantry","RU_InfSection_AA"] call XfGetConfigGroup,
	["East","RU","Infantry","RU_InfSection_MG"] call XfGetConfigGroup,
	["East","RU","Infantry","RU_SniperTeam"] call XfGetConfigGroup,
	["East","RU","Infantry","RUS_ReconTeam"] call XfGetConfigGroup,
	["East","RU","Infantry","MVD_AssaultTeam"] call XfGetConfigGroup,
	["East","INS","Infantry","INS_InfSquad"] call XfGetConfigGroup,
	["East","INS","Infantry","INS_InfSquad_Weapons"] call XfGetConfigGroup,
	["East","INS","Infantry","INS_InfSection_AA"] call XfGetConfigGroup,
	["East","INS","Infantry","INS_SniperTeam"] call XfGetConfigGroup,
	["East","INS","Infantry","INS_MilitiaSquad"] call XfGetConfigGroup
];
d_allmen_W = [
	["West","USMC","Infantry","USMC_InfSquad"] call XfGetConfigGroup,
	["West","USMC","Infantry","USMC_FireTeam"] call XfGetConfigGroup,
	["West","USMC","Infantry","USMC_FireTeam_MG"] call XfGetConfigGroup,
	["West","USMC","Infantry","USMC_FireTeam_AT"] call XfGetConfigGroup,
	["West","USMC","Infantry","USMC_FireTeam_Support"] call XfGetConfigGroup,
	["West","USMC","Infantry","USMC_HeavyATTeam"] call XfGetConfigGroup,
	["West","USMC","Infantry","USMC_SniperTeam"] call XfGetConfigGroup,
	["West","USMC","Infantry","USMC_FRTeam"] call XfGetConfigGroup,
	["West","USMC","Infantry","USMC_FRTeam_Razor"] call XfGetConfigGroup,
	["West","CDF","Infantry","CDF_InfSquad"] call XfGetConfigGroup,
	["West","CDF","Infantry","CDF_InfSquad_Weapons"] call XfGetConfigGroup,
	["West","CDF","Infantry","CDF_InfSection_AT"] call XfGetConfigGroup,
	["West","CDF","Infantry","CDF_InfSection_AA"] call XfGetConfigGroup,
	["West","CDF","Infantry","CDF_InfSection_MG"] call XfGetConfigGroup,
	["West","CDF","Infantry","CDF_InfSection_Patrol"] call XfGetConfigGroup,
	["West","CDF","Infantry","CDF_SniperTeam"] call XfGetConfigGroup
];
d_allmen_G = [
	["Guerrila","GUE","Infantry","GUE_InfSquad"] call XfGetConfigGroup,
	["Guerrila","GUE","Infantry","GUE_InfSquad_Assault"] call XfGetConfigGroup,
	["Guerrila","GUE","Infantry","GUE_InfSquad_Weapons"] call XfGetConfigGroup,
	["Guerrila","GUE","Infantry","GUE_InfTeam_1"] call XfGetConfigGroup,
	["Guerrila","GUE","Infantry","GUE_InfTeam_2"] call XfGetConfigGroup,
	["Guerrila","GUE","Infantry","GUE_InfTeam_AT"] call XfGetConfigGroup,
	["Guerrila","GUE","Infantry","GUE_GrpInf_TeamAA"] call XfGetConfigGroup,
	["Guerrila","GUE","Infantry","GUE_GrpInf_TeamSniper"] call XfGetConfigGroup,
	["Guerrila","GUE","Infantry","GUE_MilitiaSquad"] call XfGetConfigGroup
];

d_specops_E = ["RUS_Soldier_TL","RUS_Soldier_GL","RUS_Soldier_Marksman","RUS_Soldier3","RUS_Soldier1","RUS_Soldier2"];
d_specops_W = ["FR_TL","FR_AC","FR_GL","FR_Commander","FR_AR","FR_R","FR_Corpsman","FR_Marksman","FR_Sapper","FR_Assault_R","FR_Assault_GL"];
d_specops_G = ["GUE_Soldier_Sab","GUE_Soldier_Scout"];

d_sabotage_E = ["RUS_Soldier1","RUS_Soldier2"];
d_sabotage_W = ["FR_R","FR_Sapper"];
d_sabotage_G = ["GUE_Soldier_Sab"];

d_veh_a_E = if (__ACEVer) then {
	[
		["T72_RU","T90","T72_INS","ACE_T72B_RU","ACE_T72B_INS","ACE_T72BA_RU","ACE_T72BA_INS"],
		["BMP3","BMP2_INS","ACE_BMP2D_RU"],
		["BTR90","BTR90_HQ","BRDM2_INS","BRDM2_ATGM_INS","ACE_BRDM2_ATGM_RU","ACE_BRDM2_RU"],
		["2S6M_Tunguska","ZSU_INS","Ural_ZU23_INS","ACE_Ural_ZU23_RU","ACE_BRDM2_SA9_RU"],
		["GAZ_Vodnik"],
		["UAZ_AGS30_RU","UAZ_AGS30_INS","UAZ_MG_INS","UAZ_SPG9_INS","ACE_Offroad_SPG9_INS"],
		["KORD"],
		["AGS_RU","ZU23_Ins","Metis","2b14_82mm"],
		["D30_RU","GRAD_INS"],
		["KamazRefuel","ACE_UralRefuel_RU"],
		["KamazRepair","ACE_UralRepair_RU"],
		["KamazReammo","ACE_UralReammo_RU"]
	]
} else {
	[
		["T72_RU","T90","T72_INS"],
		["BMP3","BMP2_INS"],
		["BTR90","BTR90_HQ","BRDM2_INS","BRDM2_ATGM_INS"],
		["2S6M_Tunguska","ZSU_INS","Ural_ZU23_INS"],
		["GAZ_Vodnik","GAZ_Vodnik_HMG"],
		["UAZ_AGS30_RU","UAZ_AGS30_INS","UAZ_MG_INS","UAZ_SPG9_INS"],
		["KORD"],
		["AGS_RU","Igla_AA_pod_East","Metis","2b14_82mm"],
		["D30_RU","GRAD_INS"],
		["KamazRefuel"],
		["KamazRepair"],
		["KamazReammo"]
	]
};

d_veh_a_W = if (__ACEVer) then {
	[
		["ACE_M1Abrams","ACE_M1A1_HA","ACE_M1A2","ACE_M1A2_SEP"],
		["ACE_Stryker_TOW","ACE_Stryker_M2","ACE_Stryker_MK19"],
		["ACE_M113","ACE_M113_A1","ACE_M113_A3","ACE_M2A2"],
		["ACE_PIVADS","ACE_Vulcan","ACE_M6A1"],
		["ACE_HMMWV_GAU19","ACE_HMMWV_50"],
		["ACE_HMMWV_GL","ACE_HMMWV_TOW"],
		["M2StaticMG","M2HD_mini_TriPod"],
		["MK19_TriPod","Stinger_Pod","TOW_Tripod"],
		["M119"],
		["ACE_Truck5t_Refuel"],
		["ACE_Truck5t_Repair"],
		["ACE_Truck5t_Reammo"]
	]
} else {
	[
		["M1A1","M1A2_TUSK_MG","T72_CDF"],
		["LAV25","BRDM2_CDF","BRDM2_ATGM_CDF"],
		["AAV","BMP2_CDF"],
		["HMMWV_Avenger","ZSU_CDF"],
		["HMMWV_M2","HMMWV_Armored","UAZ_MG_CDF"],
		["HMMWV_MK19","HMMWV_TOW","UAZ_AGS30_CDF"],
		["M2StaticMG","M2HD_mini_TriPod","AGS_CDF"],
		["Stinger_Pod","M2HD_mini_TriPod","MK19_TriPod","M252","M2StaticMG","TOW_TriPod","ZU23_CDF"],
		["M119","MLRS","GRAD_CDF"],
		["MtvrRefuel"],
		["MtvrRepair"],
		["MtvrReammo"]
	]
};
d_veh_a_G = [
	["T72_Gue","T34"],
	["BMP2_Gue"],
	["BRDM2_Gue"],
	["Ural_ZU23_Gue"],
	["Offroad_DSHKM_Gue"],
	["Offroad_SPG9_Gue"],
	["DSHKM_Gue","2b14_82mm_GUE"],
	["2b14_82mm_GUE","SPG9_Gue"],
	["ZU23_Gue"],
	["V3S_Gue"],
	["V3S_Gue"],
	["V3S_Gue"]
];

// first element (array. for example: [2,1]): number of vehicle groups that will get spawned, the first number is the max number that will get spawned,
// the second one the minimum. So [2,0] means, there can be no vehicle groups at all or a maximum of 2 groups of this kind
// second element: maximum number of vehicles in group; randomly chosen
switch (WithLessArmor) do {
	case 0: {
		d_vehicle_numbers_guard = [
#ifndef __ACE__
			[[1,1], 1], // tanks
			[[1,1], 1], // apc (bmp)
			[[1,1], 1], // apc2 (brdm)
			[[1,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#else
			[[1,0], 1], // tanks
			[[1,0], 1], // apc (bmp)
			[[1,0], 1], // apc2 (brdm)
			[[1,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#endif
		];
		d_vehicle_numbers_guard_static = [
#ifndef __ACE__
			[[1,1], 1], // tanks
			[[1,1], 1], // apc (bmp)
			[[2,1], 1] // aa (shilka)
#else
			[[1,1], 1], // tanks
			[[1,1], 1], // apc (bmp)
			[[1,1], 1] // aa (shilka)
#endif
		];
		d_vehicle_numbers_patrol = [
#ifndef __ACE__
			[[2,1], 1], // tanks
			[[2,1], 1], // apc (bmp)
			[[2,1], 1], // apc2 (brdm)
			[[2,1], 1], // jeep with mg (uaz mg)
			[[2,1], 1] // jeep with gl (uaz grenade)
#else
			[[1,1], 1], // tanks
			[[1,1], 1], // apc (bmp)
			[[1,1], 1], // apc2 (brdm)
			[[2,1], 1], // jeep with mg (uaz mg)
			[[2,1], 1] // jeep with gl (uaz grenade)
#endif
		];

		// allmost the same like above
		// first element the max number of ai "foot" groups that will get spawned, second element minimum number (no number for vehicles in group necessary)
		d_footunits_guard = [
#ifndef __TT__
			[1,1], // basic groups
			[1,1] // specop groups
#else
			[2,1], // basic groups
			[2,1] // specop groups
#endif
		];
		d_footunits_patrol = [
#ifndef __ACE__
			[6,3], // basic groups
			[6,3] // specop groups
#else
			[4,3], // basic groups
			[5,3] // specop groups
#endif
		];
		d_footunits_guard_static = [
#ifndef __ACE__
			[2,1], // basic groups
			[0,0] // specop groups
#else
			[1,1], // basic groups
			[1,0] // specop groups
#endif
		];
	};
	case 1: {
		d_vehicle_numbers_guard = [
#ifndef __ACE__
			[[1,0], 1], // tanks
			[[1,0], 1], // apc (bmp)
			[[1,0], 1], // apc2 (brdm)
			[[1,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#else
			[[1,0], 1], // tanks
			[[1,0], 1], // apc (bmp)
			[[1,0], 1], // apc2 (brdm)
			[[1,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#endif
		];
		d_vehicle_numbers_guard_static = [
#ifndef __ACE__
			[[1,0], 1], // tanks
			[[1,0], 1], // apc (bmp)
			[[1,0], 1] // aa (shilka)
#else
			[[1,0], 1], // tanks
			[[1,0], 1], // apc (bmp)
			[[1,0], 1] // aa (shilka)
#endif
		];
		d_vehicle_numbers_patrol = [
#ifndef __ACE__
			[[1,0], 1], // tanks
			[[1,0], 1], // apc (bmp)
			[[1,0], 1], // apc2 (brdm)
			[[1,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#else
			[[1,0], 1], // tanks
			[[1,0], 1], // apc (bmp)
			[[1,0], 1], // apc2 (brdm)
			[[1,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#endif
		];

		// allmost the same like above
		// first element the max number of ai "foot" groups that will get spawned, second element minimum number (no number for vehicles in group necessary)
		d_footunits_guard = [
#ifndef __TT__
			[3,1], // basic groups
			[3,1] // specop groups
#else
			[3,1], // basic groups
			[3,1] // specop groups
#endif
		];
		d_footunits_patrol = [
#ifndef __ACE__
			[9,3], // basic groups
			[9,3] // specop groups
#else
			[8,3], // basic groups
			[8,3] // specop groups
#endif
		];
		d_footunits_guard_static = [
#ifndef __ACE__
			[4,1], // basic groups
			[2,1] // specop groups
#else
			[3,1], // basic groups
			[2,1] // specop groups
#endif
		];
	};
	case 2: {
		d_vehicle_numbers_guard = [
#ifndef __ACE__
			[[0,0], 1], // tanks
			[[0,0], 1], // apc (bmp)
			[[0,0], 1], // apc2 (brdm)
			[[2,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#else
			[[0,0], 1], // tanks
			[[0,0], 1], // apc (bmp)
			[[0,0], 1], // apc2 (brdm)
			[[2,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#endif
		];
		d_vehicle_numbers_guard_static = [
#ifndef __ACE__
			[[0,0], 1], // tanks
			[[0,0], 1], // apc (bmp)
			[[0,0], 1] // aa (shilka)
#else
			[[0,0], 1], // tanks
			[[0,0], 1], // apc (bmp)
			[[0,0], 1] // aa (shilka)
#endif
		];
		d_vehicle_numbers_patrol = [
#ifndef __ACE__
			[[0,0], 1], // tanks
			[[0,0], 1], // apc (bmp)
			[[0,0], 1], // apc2 (brdm)
			[[2,1], 1], // jeep with mg (uaz mg)
			[[2,1], 1] // jeep with gl (uaz grenade)
#else
			[[0,0], 1], // tanks
			[[0,0], 1], // apc (bmp)
			[[0,0], 1], // apc2 (brdm)
			[[2,1], 1], // jeep with mg (uaz mg)
			[[1,1], 1] // jeep with gl (uaz grenade)
#endif
		];

		// allmost the same like above
		// first element the max number of ai "foot" groups that will get spawned, second element minimum number (no number for vehicles in group necessary)
		d_footunits_guard = [
#ifndef __TT__
			[4,1], // basic groups
			[3,1] // specop groups
#else
			[5,3], // basic groups
			[2,1] // specop groups
#endif
		];
		d_footunits_patrol = [
#ifndef __ACE__
			[10,3], // basic groups
			[10,3] // specop groups
#else
			[4,3], // basic groups
			[2,3] // specop groups
#endif
		];
		d_footunits_guard_static = [
#ifndef __ACE__
			[5,1], // basic groups
			[3,1] // specop groups
#else
			[4,3], // basic groups
			[2,1] // specop groups
#endif
		];
	};
};

d_arti_observer_E = "RU_Soldier_Spotter";
d_arti_observer_W = "USMC_Soldier_Officer";
d_arti_observer_G = "GUE_Commander";

// type of enemy plane that will fly over the main target
#ifndef __ACE__
d_airki_attack_plane = switch (d_enemy_side) do {
	case "EAST": {["Su34","Su39"]};
	case "WEST": {["A10","AV8B2","AV8B","F35B"]};
	default {[]};
};
#endif
#ifdef __ACE__
d_airki_attack_plane = switch (d_enemy_side) do {
	case "EAST": {["Su34","Su39","ACE_Su27_CAP","ACE_Su27_CAS","ACE_Su27_CASP"]};
	case "WEST": {["A10","AV8B2","AV8B","F35B"]};
	default {[]};
};
#endif
d_number_attack_planes = 0;

// type of enemy chopper that will fly over the main target
d_airki_attack_chopper = switch (d_enemy_side) do {
	case "EAST": {["ACE_Mi17_RU","Mi17_rockets_RU"]};
	case "WEST": {["AH1Z"]};
	default {[]};
};

d_number_attack_choppers = 1;

// enemy parachute troops transport chopper
d_transport_chopper = switch (d_enemy_side) do {
	case "EAST": {["Mi17_rockets_RU"]};
	case "WEST": {["MH60S"]};
	case "GUER": {["Mi17_Civilian"]};
};

// light attack chopper (for example Mi17 with MG)
d_light_attack_chopper = switch (d_enemy_side) do {
	case "EAST": {["Mi17_Ins"]};
	case "WEST": {["UH1Y"]};
	default {[]};
};

// enemy ai skill: [base skill, random value (random 0.3) that gets added to the base skill]
d_skill_array = switch (EnemySkill) do {
	case 1: {[0.1,0.3]};
	case 2: {[0.2,0.3]};
	case 3: {[0.4,0.3]};
};

// Type of aircraft, that will air drop stuff
x_drop_aircraft =
#ifdef __OWN_SIDE_GUER__
	"MH60S";
#endif
#ifdef __OWN_SIDE_WEST__
	"C130J";
#endif
#ifdef __OWN_SIDE_EAST__
	"Mi17_rockets_RU";
#endif
#ifdef __TT__
	"MH60S";
#endif
	
if (d_with_ai) then {
x_taxi_aircraft =
#ifdef __OWN_SIDE_GUER__
	"MH60S";
#endif
#ifdef __OWN_SIDE_WEST__
	"MH60S";
#endif
#ifdef __OWN_SIDE_EAST__
	"Mi17_rockets_RU";
#endif
#ifdef __TT__
	"MH60S";
#endif
};

// max men for main target clear
d_man_count_for_target_clear = 4;
// max tanks for main target clear
d_tank_count_for_target_clear = 0;
// max cars for main target clear
d_car_count_for_target_clear = 0;

// add some random patrols on the island
// if the array is empty, no patrols
// same size like a rectangular trigger
// first element = center position, second element = a, third element = b, fourth element = angle, fifth element = number of groups
d_with_isledefense = if (WithIsleDefense == 0) then {
	[]
} else {
	[]
};

// if set to false, empty vehicles will not get deleted after the main target gets cleared. true = empty vehicles will get deleted after 25-30 minutes
d_do_delete_empty_main_target_vecs = true;

#ifndef __TT__
// if set to true no enemy AI will attack base and destroy bonus vehicles or whatever
d_no_sabotage = if (WithBaseAttack == 0) then {false} else {true};
#endif

// time (in sec) between attack planes and choppers over main target will respawn once they were shot down (a random value between 0 and 240 will be added)
d_airki_respawntime = 3600;

d_side_missions_random = [];

#ifndef __TT__
// don't remove d_recapture_indices even if you set d_with_recapture to false
d_recapture_indices = [];
// if set to false enemy forces will not recapture towns !!!
d_with_recapture = if (WithRecapture == 0) then {true} else {false};

// max number of cities that the enemy will recapture at once
// if set to -1 no check is done
d_max_recaptures = 1;

if (isNil "d_with_carrier") then {
	[] spawn {
		_wairfac = switch (d_own_side) do {
			case "WEST": {"USMC_WarfareBAircraftFactory"};
			case "EAST": {"RU_WarfareBAircraftFactory"};
			case "GUER": {"WarfareBAircraftFactory_Gue"};
		};
		_pos = (d_aircraft_facs select 0) select 0;
		_dir = (d_aircraft_facs select 0) select 1;
		["d_jet_serviceH",false] call XNetSetJIP;
		_fac = createVehicle [_wairfac, _pos, [], 0, "NONE"];
		_fac setPos _pos;
		_fac setDir _dir;
		_fac addEventHandler ["killed", {[_this select 0, 0] spawn x_fackilled}];

		_pos = (d_aircraft_facs select 1) select 0;
		_dir = (d_aircraft_facs select 1) select 1;
		["d_chopper_serviceH",false] call XNetSetJIP;
		_fac = createVehicle [_wairfac, _pos, [], 0, "NONE"];
		_fac setPos _pos;
		_fac setDir _dir;
		_fac addEventHandler ["killed", {[_this select 0, 1] spawn x_fackilled}];

		_pos = (d_aircraft_facs select 2) select 0;
		_dir = (d_aircraft_facs select 2) select 1;
		["d_wreck_repairH",false] call XNetSetJIP;
		_fac = createVehicle [_wairfac, _pos, [], 0, "NONE"];
		_fac setPos _pos;
		_fac setDir _dir;
		_fac addEventHandler ["killed", {[_this select 0, 2] spawn x_fackilled}];
	};
};
#endif

d_time_until_next_sidemission = [
	[10,300], // if player number <= 10, it'll take 300 seconds = 5 minutes until the next sidemission
	[20,300], // if player number <= 20, it'll take 600 seconds = 10 minutes until the next sidemission
	[30,300], // if player number <= 30, it'll take 900 seconds = 15 minutes until the next sidemission
	[40,300] // if player number <= 40, it'll take 1200 seconds = 20 minutes until the next sidemission
];

d_civilians_t = ["Assistant","Citizen1","Citizen2","Citizen2","Citizen4","Worker1","Worker2","Worker3","Worker4","Priest","Doctor","Functionary1","Functionary2","Damsel1","Damsel2","Damsel3","Damsel4","Damsel5","Profiteer1","Profiteer2","Profiteer3","Profiteer4","Rocker1","Rocker2","Rocker3","Rocker4","Woodlander1","Woodlander2","Woodlander3","Woodlander4","Villager1","Villager2","Villager3","Villager4","Secretary1","Secretary2","Secretary3","Secretary4","Sportswoman1","Sportswoman2","Sportswoman3","Sportswoman4","Madam1","Madam2","Madam3","Madam4","Farmwife1","Farmwife2","Farmwife3","Farmwife4","HouseWife1","HouseWife2","HouseWife3","HouseWife4","Hooker1","Hooker2","Hooker3","Hooker4","WorkWoman1","WorkWoman2","WorkWoman3","WorkWoman4","SchoolTeacher","Policeman"];

// position and direction of the AI HUT
d_pos_ai_hut = 
#ifdef __DEFAULT__
	//if (isNil "d_with_carrier") then {[[4671.4,10203.9,0],325]} else {[[14509.6,364.861,15.9], 34]};
	if (isNil "d_with_carrier") then {[[4671.4,10203.9,0],325]} else {[[14509.6,364.861,15.9], 34]};
#endif
#ifdef __EVERON__
	if (isNil "d_with_carrier") then {[[4891.39,11722.6,0],270]} else {[[14696.9,543.778,15.9], 34]};
#endif
#ifdef __TT__
	[];
#endif

if (d_with_ai) then {
	_wbarracks = switch (d_own_side) do {
		case "WEST": {if (isNil "d_with_carrier") then {"USMC_WarfareBBarracks"} else {"WarfareBunkerSign"}};
		case "EAST": {"RU_WarfareBBarracks"};
		case "GUER": {"Gue_WarfareBBarracks"};
	};

	_D_AI_HUT = createVehicle [_wbarracks, (d_pos_ai_hut select 0), [], 0, "NONE"];
	_D_AI_HUT setDir (d_pos_ai_hut select 1);
	if (isNil "d_with_carrier") then {
		_D_AI_HUT setPos (d_pos_ai_hut select 0)
	} else {
		_D_AI_HUT setPosASL (d_pos_ai_hut select 0)
	};
	_D_AI_HUT allowDamage false;
	["D_AI_HUT",_D_AI_HUT] call XNetSetJIP;
};

#ifdef __CARRIER__
d_chop_s_trig setPosASL [position d_chop_s_trig select 0, position d_chop_s_trig select 1, 15.9];
d_jet_s_trig setPosASL [position d_jet_s_trig select 0, position d_jet_s_trig select 1, 15.9];
#endif

d_banti_airdown = false;
};